#!/usr/bin/python

class node:
	def __init__(self, a, b):
		self.a = a
		self.b = b
	def print_node(self):
		print self.a, self.b

list = []
for i in range(0, 5):
	list.append(node(5 - i, i))
for node in list:
	node.print_node()

print

list.sort(lambda x, y:cmp(x.a, y.a))
for node in list:
	node.print_node()
